﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DefaultViewState : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(ViewState.Count > 0)
        {
            Literal1.Text = ViewState["my"].ToString();
        }
        Literal1.Text += HiddenField1.Value; 
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = "xyz";
        ViewState["my"] = "abc";
    }
}